home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CRandom 1.0 / CRandom.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  891 b   |  47 lines  |  [TEXT/KAHL]

  1. /*
  2.  * CRandom.h
  3.  * Version 1.1.1, 14 April 1992
  4.  *
  5.  * © Copyright 1992 by James R. McCarthy.  All rights reserved.
  6.  * This code can be both distributed and used freely.
  7.  *
  8.  */
  9.  
  10.  
  11.  
  12. /******************************/
  13.  
  14. #pragma once
  15.  
  16. /******************************/
  17.  
  18. #define NRANDOMSLOTS (97)
  19. #define NDISTINCTRANDOMVALUES (714025)
  20.  
  21. /******************************/
  22.  
  23. #include <Global.h>
  24. #include <oops.h>
  25.  
  26. /******************************/
  27.  
  28.  
  29.  
  30. struct CRandom : indirect {
  31.     unsigned long    seeds[NRANDOMSLOTS];
  32.     unsigned long    dummy;
  33.     unsigned long    value;
  34.     
  35.     void            IRandom(void);
  36.     
  37.     void            seed(unsigned long seedVal);
  38.     
  39.     short            linearShort(short lowest, short highest);
  40.     
  41.     void            randomizeArray(short nElements, Ptr theArray, short elementSize);
  42.     void            randomizeShortArray(short nElements, short *theArray);
  43.     void            randomizeLongArray(short nElements, long *theArray);
  44. } ;
  45.  
  46. extern CRandom *gRandom;
  47.